<!-- 备案材料清单 -->
<template>
  <section class="content" id="content">
    <el-row>
      <el-col :span="4"></el-col>
      <el-col :span="16">
        <el-row v-for="(item,idx) in dataList" :key="idx"
                :gutter="1"
                align="middle"
                justify="rigit"
                class="file-list-table">
          <el-col :span="10">{{ fileTitleList[idx] }}</el-col>
          <el-col :span="14" >
            <lq-file-upload :file="file"
                            :fileList="fileList[item.key]"
                            :data="dataList[idx]"
                            :events="eventList[idx]"
                            :ref="dataList[idx]+'FileRef'">
            </lq-file-upload>
          </el-col>
<!--          <el-col :span="7"></el-col>-->
        </el-row>
      </el-col>
      <el-col :span="4"></el-col>
    </el-row>

  </section>
</template>

<script setup lang="ts">
import {
  ref,
  reactive,
  onMounted,
  inject,
  watch,
  nextTick,
  getCurrentInstance,
  toValue
} from "vue";
import type {UploadFile, UploadFiles, UploadRawFile} from "element-plus";

import {ElMessage, ElMessageBox} from "element-plus";
// import LqForm from "@/pages/components/LqForm.vue";
import LqFileUpload from "@/pages/components/LqFileUpload.vue";
import {
  uploadURL,
  editKey,
  registerFileIdKey,
  removeFileParamKey
} from '../../components/keys.js';

/**
 * 全局方法引入
 */
const global = getCurrentInstance().appContext.config.globalProperties;

const optCase = inject(editKey);
//备案清单ID for add
const registerFileId = inject(registerFileIdKey);
const removeFileParam = inject(removeFileParamKey);

const fileTitleList = ref([
  '1、申请表',
  '2、重大危险源辨识、分级记录',
  '3、重大危险源基本特征表',
  '4、涉及的所有化学品安全技术说明书',
  '5、区域位置图、平面布置图、工艺流程图和主要设备表',
  '6、重大危险源安全管理规章制度及安全操作规程',
  '7、安全监测监控系统、措施说明和检测检验结果',
  '8、事故应急预案、评审意见、演练计划和评估报告',
  '9、安全评价或评估报告',
  '10、重大危险源场所安全警示标志的设置情况',
  '11、重大危险源关键装置、重点部位责任人',
  '12、其他文件、资料'
]);

//{attachmentKey: 'applicationForm', attachmentId: 'xxxxxxxxxxx'}
// const registerFile = ref([]);



//========== file ============
const dataList = ref([
  {
    key: 'applicationForm',
    value: '申请表',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'gradedRecord',
    value: '重大危险源辨识、分级记录',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'basicFeature',
    value: '重大危险源基本特征表',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'technicalManual',
    value: '涉及的所有化学品安全技术说明书',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'layoutDevice',
    value: '区域位置图、平面布置图、工艺流程图和主要设备表',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'opRules',
    value: '重大危险源安全管理规章制度及安全操作规程',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'testResult',
    value: '安全监测监控系统、措施说明和检测检验结果',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'planReport',
    value: '事故应急预案、评审意见、演练计划和评估报告',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'safetyReport',
    value: '安全评价或评估报告',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'warningSign',
    value: '重大危险源场所安全警示标志的设置情况',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'keyDevice',
    value: '重大危险源关键装置、重点部位责任人',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  },
  {
    key: 'etc',
    value: '其他文件、资料',
    hazardInfoId: optCase.value.hazardInfoId,
    hazardCode: optCase.value.hazardCode,
    registerFileId: registerFileId.value
  }
]);

const _files  = new Array(12);
const uploadFileList = ref(_files);
const fileList = ref({
  applicationForm: [],
  gradedRecord: [],
  basicFeature: [],
  technicalManual: [],
  layoutDevice: [],
  opRules: [],
  testResult: [],
  planReport: [],
  safetyReport: [],
  warningSign: [],
  keyDevice: [],
  etc: []
});

const file = ref({
  innerAttrs: {
    disabled: false,
    multiple: false,
    drag: true,
    accept: '.rar,.zip,.doc,.docx,.pdf',
    name: 'files', //上传的文件字段名,默认为：file
    limit: 10,
  },
  autoUpload: true,
  url: uploadURL,
  acceptMaxSize: 10,    //Kbyte,最大上传文件大小
})

const eventList =[
  { /* 1 */
    /**
     *  data: {id: '6899...', batchId: 'a171...', hazardCode: '',hazardInfoId: '', file: '/2024-02-23/1708695672665_2_web项目架构（参考）2.pdf', sort: 1, createUser: 'lllll',}
     */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      console.log('文件名：%s, 响应信息：%o ', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[0] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.applicationForm = {id: data.id, registerFileId: data.batchId, key: 'applicationForm'};
        uploadTips(uploadFile, uploadFiles);
      }
    },
    //文件状态改变时的钩子，添加文件、上传成功和上传失败时都会被调用
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      console.log('remove file id:%o', removeFileParam.value.applicationForm);

      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.applicationForm)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* === 2 ====*/
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[1] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.gradedRecord = {id: data.id, registerFileId: data.batchId, key: 'gradedRecord'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      console.log('remove file id:%o', removeFileParam.value.gradedRecord);

      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.gradedRecord)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* 3 */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[2] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.basicFeature = {id: data.id, registerFileId: data.batchId, key: 'basicFeature'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.basicFeature)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* 4 */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[3] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.technicalManual = {id: data.id, registerFileId: data.batchId, key: 'technicalManual'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.technicalManual)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* 5 */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[4] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.layoutDevice = {id: data.id, registerFileId: data.batchId, key: 'layoutDevice'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.layoutDevice)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* 6 */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[5] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.opRules = {id: data.id, registerFileId: data.batchId, key: 'opRules'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.opRules)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* 7 */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[6] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.testResult = {id: data.id, registerFileId: data.batchId, key: 'testResult'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.testResult)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* 8 */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[7] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.planReport = {id: data.id, registerFileId: data.batchId, key: 'planReport'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.planReport)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* 9 */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[8] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.safetyReport = {id: data.id, registerFileId: data.batchId, key: 'safetyReport'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.safetyReport)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* 10 */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[9] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.warningSign = {id: data.id, registerFileId: data.batchId, key: 'warningSign'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.warningSign)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* 11 */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[10] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.keyDevice = {id: data.id, registerFileId: data.batchId, key: 'keyDevice'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.keyDevice)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  },
  { /* 12 */
    handleSuccess: (resp: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('文件名：%s, 响应信息：%o', uploadFile.name, resp);
      const { data } = resp;
      if (resp.status === 'OK') {
        uploadFileList.value[11] = {'id': data.id, 'batchId': data.batchId, 'fileName': uploadFile.name, 'url': data.file};
        removeFileParam.value.etc = {id: data.id, registerFileId: data.batchId, key: 'etc'};
        uploadTips(uploadFile, uploadFiles, '上传');
      }
    },
    handleChange: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      // console.log('改变文件名: %s',uploadFile.name);
    },
    handleRemove: (uploadFile: UploadFile, uploadFiles: UploadFiles) => {
      global.$api.deleteRegisterFile(Object.assign({}, removeFileParam.value.etc)).then(({data}) => {
        if (data.status === 'OK') {
          uploadTips(uploadFile, uploadFiles, '删除');
        }
      })
    },
  }
]

onMounted(()=>{
  console.log('操作：%s  InfoId: %s  HazardCode: %s',optCase.value.operaCase, optCase.value.hazardInfoId||'null', optCase.value.hazardCode||'null');

  if (optCase.value.operaCase==='add' && (optCase.value.hazardInfoId==='' || optCase.value.hazardCode==='')) {
    file.value.innerAttrs.disabled = false;
  }else if (optCase.value.operaCase==='edit') {
    file.value.innerAttrs.disabled = false;
  } else if (optCase.value.operaCase==='view'){ //view
    file.value.innerAttrs.disabled = true;
  }

  if (optCase.value.operaCase !== 'add'){
    //查找此危险源信息是否有备案材料清单
    global.$api.getRegisterFileByInfoId({
      hazardInfoId: optCase.value.hazardInfoId

    }).then(({data}) => {
      if (data.status === 'OK') {
        //{registerFile: {...}, fileList: [{...}]}
        // console.log('registerFile ==>>',data.data.registerFile);
        // console.log('fileList ==>>', ...data.data.fileList);

        if(data.data.registerFile.id && data.data.registerFile.id !== ''){
          nextTick(()=>{
            registerFileId.value = data.data.registerFile.id;
            console.log('Edit时 查到的 备案材料id:%s', registerFileId.value);

            dataList.value.forEach(item => {
              item.registerFileId = data.data.registerFile.id;
              // console.log('data item registerFileId:%s', item.registerFileId);
            })
          })
          const fileItems = data.data.fileList;
          removeFileParam.value.applicationForm = { id: fileItems[0].id, registerFileId: data.data.registerFile.id, key: 'applicationForm'};
          removeFileParam.value.gradedRecord = { id: fileItems[1].id, registerFileId: data.data.registerFile.id, key: 'gradedRecord'};
          removeFileParam.value.basicFeature = { id: fileItems[2].id, registerFileId: data.data.registerFile.id, key: 'basicFeature'};
          removeFileParam.value.technicalManual = { id: fileItems[3].id, registerFileId: data.data.registerFile.id, key: 'technicalManual'};
          removeFileParam.value.layoutDevice = { id: fileItems[4].id, registerFileId: data.data.registerFile.id, key: 'layoutDevice'};
          removeFileParam.value.opRules = { id: fileItems[5].id, registerFileId: data.data.registerFile.id, key: 'opRules'};
          removeFileParam.value.testResult = { id: fileItems[6].id, registerFileId: data.data.registerFile.id, key: 'testResult'};
          removeFileParam.value.planReport = { id: fileItems[7].id, registerFileId: data.data.registerFile.id, key: 'planReport'};
          removeFileParam.value.safetyReport = { id: fileItems[8].id, registerFileId: data.data.registerFile.id, key: 'safetyReport'};
          removeFileParam.value.warningSign = { id: fileItems[9].id, registerFileId: data.data.registerFile.id, key: 'warningSign'};
          removeFileParam.value.keyDevice = { id: fileItems[10].id, registerFileId: data.data.registerFile.id, key: 'keyDevice'};
          removeFileParam.value.etc = { id: fileItems[11].id, registerFileId: data.data.registerFile.id, key: 'etc'};

          fileList.value.applicationForm = fileItems[0].id ? [{name: handleFileName(fileItems[0].file), url: fileItems[0].file}] : [];
          fileList.value.gradedRecord = fileItems[1].id ? [{name: handleFileName(fileItems[1].file), url: fileItems[1].file }] : [];
          fileList.value.basicFeature = fileItems[2].id ? [{name: handleFileName(fileItems[2].file), url: fileItems[2].file }] : [];
          fileList.value.technicalManual = fileItems[3].id ? [{name: handleFileName(fileItems[3].file), url: fileItems[3].file }] : [];
          fileList.value.layoutDevice = fileItems[4].id ? [{name: handleFileName(fileItems[4].file), url: fileItems[4].file }] : [];
          fileList.value.opRules = fileItems[5].id ? [{name: handleFileName(fileItems[5].file), url: fileItems[5].file }] : [];
          fileList.value.testResult = fileItems[6].id ? [{name: handleFileName(fileItems[6].file), url: fileItems[6].file }] : [];
          fileList.value.planReport = fileItems[7].id ? [{name: handleFileName(fileItems[7].file), url: fileItems[7].file }] : [];
          fileList.value.safetyReport = fileItems[8].id ? [{name: handleFileName(fileItems[8].file), url: fileItems[8].file }] : [];
          fileList.value.warningSign = fileItems[9].id ? [{name: handleFileName(fileItems[9].file), url: fileItems[9].file }] : [];
          fileList.value.keyDevice = fileItems[10].id ? [{name: handleFileName(fileItems[10].file), url: fileItems[10].file }] : [];
          fileList.value.etc = fileItems[11].id ? [{name: handleFileName(fileItems[11].file), url: fileItems[11].file}] : [];

        } else {
          global.$api.generateIdForRegisterFile({}).then(({data}) => {
            nextTick(()=>{
              registerFileId.value = data.data.id;
              console.log('Edit时 上传附件 预生成的 备案材料id:%s', registerFileId.value);
              dataList.value.forEach(item => {
                item.registerFileId = data.data.id;
                // console.log('data item registerFileId:%s', item.registerFileId);
              })
            })
          })
        }
      }
    });
  } // end if
})

const handleFileName = (filename) => {
  if (filename && filename.lastIndexOf('/') != -1) {
    return filename.substring(filename.lastIndexOf('/')+15, filename.length);
  }else{
    return '';
  }
}

const uploadTips = (uploadFile: UploadFile, uploadFiles: UploadFiles,word='操作')=>{
  ElMessage({
    type: 'success',
    dangerouslyUseHTMLString: true,
    message: `【${uploadFile.name}】文件${word}成功！`
  })
}

</script>

<style scoped lang="sass">
.file-list-table
  border: 1px solid #000
  border-collapse: collapse
.upload-demo .el-upload-dragger
  padding: 0px !important
</style>
